package com.cbhb.sys;

public class ArrayStringsAreEqual {
    public static boolean arrayStringsAreEqual(String[] word1, String[] word2) {
        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();
        for(String str:word1) {
            sb1.append(str);
        }
        System.out.println(sb1);
        for(String str:word2) {
            sb2.append(str);
        }
        System.out.println(sb2);
        return sb1.toString().equals(sb2.toString());
    }

    public static void main(String[] args) {
        System.out.println(arrayStringsAreEqual(new String[]{"ab", "c"}, new String[]{"a", "bc"}));
    }
}
